/*******************************************************************************
* Copyright (c) 2010, 2018 西安秦晔信息科技有限公司
* Licensed under the Apache License, Version 2.0 (the "License");
*    you may not use this file except in compliance with the License.
*    You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS,
*    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*    See the License for the specific language governing permissions and
*    limitations under the License.
*******************************************************************************/
package com.qinyeit.serviceapp.service.branchstores;

import com.alibaba.fastjson.JSONObject;
import com.qinyeit.serviceapp.entity.MaterialCost;
import com.qinyetech.springstage.core.entity.search.Searchable;
import com.qinyetech.springstage.core.service.IBaseService;
import org.springframework.data.domain.Page;

import java.util.Map;

/** 
 * ClassName: MaterialCostService <br/> 
 * Function: 成本卡业务功能 <br/> 
 * date: 2018-12-01 14:09:56 <br/> 
 * 
 * @author liuwenjin
 * @version 1.0
 * @since JDK 1.8
 */
public interface MaterialCostService extends IBaseService<MaterialCost, Long>{

    /**
     * 获取所有菜品 不同规格可以建立不同成本卡
     * @param searchable
     * @return
     */
    Page<Map<String,Object>> findAllForDishes(Searchable searchable, Long merchantGroupId);


    /**
     * c查询一条菜品信息
     * @param specId
     * @param dishesId
     * @return
     */
    Object findDishOne(Long specId,Long dishesId,Long merchantGroupId,Long storeId);

    /**
     * 保存成本卡
     * @param data
     *    modelForm:{
     *        warehouseId:仓库id
     *        storeId:菜品库id\
     *        dishesId:菜品id
     *        specId:规格id
     *        remark:备注
     *        cost：成本
     *        materialCost：原料成本
     *        otherCost：其他成本
     *        processQty：加工分数
     *    }
     *    items:[
     *      {
     *          memo:备注
     *          id：原料id
     *          count:消耗数量
     *          isMain：是否主料
     *      }
     *    ]
     * @param merchantGroupId
     *
     */
    void saveData(JSONObject data,Long merchantGroupId);

    /**
     * 删除成本卡详情
     * @param id
     */
    void  deleteDetails(Long id);
}